<ul class="library-list">
<?php foreach($files as $index=>$file):?>

	<?php if(($index+1) % 3 == 0):?>
	
				<li class="last">
					<a href="<?php echo $file->getAnnotateFileDownloadURL()?>"><img src="<?php echo $file->getAnnotateThumbnailURL()?>" alt="Sample Library Item" /></a>
					<h4><a href="#"><?php echo $file->getName()?></a></h4>
					<p class="meta"><?php echo $file->getDownloadCount()?> Download(s) &nbsp;|&nbsp; <!--  PDF &nbsp;|&nbsp;--> [<?php echo $file->getSize()/1000?> MB] &nbsp;|&nbsp; <a target="blank" href="<?php echo $file->getAnnotateFileViewURL()?>">annotate</a></p>

					<p><?php echo $file->getDescription();?></p>
				</li>
	
	
	<?php else:?>

				<li>
					<a href="<?php  echo $file->getAnnotateFileDownloadURL()?>"><img src="<?php echo $file->getAnnotateThumbnailURL()?>" alt="Sample Library Item" /></a>
					<h4><a href="#"><?php echo $file->getName()?></a></h4>
					<p class="meta"><?php echo $file->getDownloadCount()?> Download(s) &nbsp;|&nbsp; <!--  PDF &nbsp;|&nbsp;--> [<?php echo $file->getSize()/1000?> MB] &nbsp;|&nbsp; <a target="blank" href="<?php echo $file->getAnnotateFileViewURL()?>">annotate</a></p>

					<p><?php echo $file->getDescription();?></p>
				</li>
	
	<?php endif?>
<?php endforeach?>
</ul>